package mysql

import "gorm.io/gorm"

type Order struct {
	gorm.Model
	Total     int    `gorm:"type:int(11);not null;index:ip_idx"`
	NumberIng string `gorm:"type:varchar(96);not null;"`
	Title     string `gorm:"type:varchar(11);not null;"`
	Stock     int    `gorm:"type:int(11);not null;"`
	Status    string `gorm:"type:varchar(42);not null;"`
}
type OrderGood struct {
	gorm.Model
	Total     int    `gorm:"type:int(11);not null;index:ip_idx"`
	NumberIng string `gorm:"type:varchar(96);not null;"`
	Price     int    `gorm:"type:int(11);not null;"`
	Stock     int    `gorm:"type:int(11);not null;"`
	Status    string `gorm:"type:varchar(87);not null;"`
}

func (O *Order) Order() error {
	return DB.Debug().Create(&O).Error
}
func (OG *OrderGood) OrderGood() error {
	return DB.Debug().Create(&OG).Error
}
